
#include "network_filter_tee.h"
#include "assert.h"


network_filter_tee::network_filter_tee()
	:network_filter_base( FAD_UNKNOWN, FAD_UNKNOWN )
{
}


network_filter_tee::~network_filter_tee()
{
}

bool network_filter_tee::set_network_filter(interface_network_filter * ptr_obj)
{
	if (!ptr_obj)
		return false;

	m_filter_list.push_back(ptr_obj);

	return true;
}

bool network_filter_tee::set_parent_network_filter(interface_network_filter * ptr_obj)
{
	if (!ptr_obj)
		return false;

	m_ptr_parent = ptr_obj;

	m_output_type = m_input_type = m_ptr_parent->get_filter_output_datatype();

	return true;
}

void network_filter_tee::send_network_data(FILTER_ACCEPT_DATATYPE type, void * ptr_data)
{
	std::vector< interface_network_filter * >::iterator iter = m_filter_list.begin();
	std::vector< interface_network_filter * >::iterator itere = m_filter_list.end();

	while (iter != itere)
	{
		(*iter)->recv_network_data(type, ptr_data);

		iter++;
	}
}

void network_filter_tee::process_network_data(FILTER_ACCEPT_DATATYPE type, void * ptr_data)
{
	send_network_data(type, ptr_data);
}
